package com.jml.juc;


import java.util.concurrent.CountDownLatch;

/**
 * @author:jml
 * @date: 2019/5/5 10:36
 * @description：
 */
public class CountDownLatchDemo {

    public static void main(String[] args) throws InterruptedException {

        CountDownLatch countDownLatch = new CountDownLatch(3);
        for (int i = 0; i < 6 ; i++) {
            int finalI = i;
            new Thread(()->{
                System.out.println(Thread.currentThread().getName());
                countDownLatch.countDown();
                System.out.println("zxxz");
            },CountryEnum.forEach_Enum(i).getS()).start();
        }
        countDownLatch.await();
        System.out.println("最后关门");

    }
}
